<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

  <div id="app">
    <h2>{{message}}</h2>

    <!--插值方式-->
    <h2>{{firstName + ' ' + lastName}}</h2>

    <!--封装方法方式-->
    <h2 >{{getFullName()}}</h2>

    <!-- 计算属性方式-->
    <h2 >{{fullName}}</h2>

  </div>

<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<script>
  const app = new Vue({
    el: "#app",
    data: {
      message: "hello world !",
      firstName: 'lebron',
      lastName: 'James'
    },
    /*计算属性方式*/
    computed: {
      fullName: function (){
        return this.firstName + ' ' + this.lastName;
      }
    },
    methods: {
      /*封装方法方式*/
      getFullName: function (){
        return this.firstName + ' ' + this.lastName;
      }
    }
  })

</script>


</body>
</html>